//
//  AudioVolumeDisplay.m
//  LinkUsMessage_iOS
//
//  Created by lcy on 16/1/4.
//  Copyright © 2016年 lcy. All rights reserved.
//

#import "LCYAudioVolumeDisplay.h"

@interface LCYAudioVolumeDisplay ()

@end

@implementation LCYAudioVolumeDisplay

+ (UINib *)nib
{
    return [UINib nibWithNibName:NSStringFromClass([self class])
                          bundle:[NSBundle bundleForClass:[self class]]];
}

#pragma mark - Initialization

- (void)awakeFromNib
{
    [super awakeFromNib];
    self.layer.cornerRadius = 5;
    self.hidden = YES;
    
    _imgViews = @[_volumeLevel_0,
                  _volumeLevel_1,
                  _volumeLevel_2,
                  _volumeLevel_3,
                  _volumeLevel_4,
                  _volumeLevel_5
                  ];
}


// 设置音量
- (void)setAudioVolumeLevel:(int)volumeLevel
{
    
    int i = 0;
    for (UIView *view in self.imgViews) {
        
        if (i <= volumeLevel) {
            view.hidden = NO;
        } else {
            view.hidden = YES;
        }
        
        i++;
    }
    
    [self setNeedsDisplay];
}

@end
